package com.cloudcc.mobile.event;

import com.cloudcc.cloudframe.util.StringUtils;

/**
 * 数据事件
 * 
 * @author wangzhiqiang
 * @date 2015-6-15 下午3:16:13
 * 
 * @param <T>
 */
public class ResultEvent<T> {
	public T data;
	public int page;
	public boolean ok;
	public String message = StringUtils.EMPTY;
	public int statusCode;
	public int requestCode;

	public ResultEvent() {
		super();
	}

	public ResultEvent(boolean isOk, String meg) {
		super();
		this.ok = isOk;
		this.message = meg;
	}

	public ResultEvent(boolean isOk, String meg, int statusCode) {
		super();
		this.ok = isOk;
		this.message = meg;
		this.statusCode = statusCode;
	}

	/**
	 * 数据访问是否出现问题
	 * 
	 * @return
	 */
	public boolean isError() {
		return !ok;
	}

	@Override
	public String toString() {
		return "isok:" + ok + "##" + "meg:" + message;
	}

}
